 package tools.packet;

 import client.MapleCharacter;
 import client.skills.KSPsychicSkillEntry;
 import configs.ServerConfig;
 import handling.opcode.EffectOpcode;
 import handling.opcode.MessageOpcode;
 import handling.opcode.SendPacketOpcode;
 import java.awt.Point;
 import java.util.Iterator;
 import java.util.List;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import tools.Pair;
 import tools.Randomizer;
 import tools.data.output.MaplePacketLittleEndianWriter;









 public class EffectPacket
 {
/*  28 */   private static final Logger log = LogManager.getLogger(EffectPacket.class);

   public static byte[] showOwnBuffEffect(int skillid, int effectid, int playerLevel, int skillLevel) {
/*  31 */     return showOwnBuffEffect(skillid, effectid, playerLevel, skillLevel, (byte)4);
   }

   public static byte[] showOwnBuffEffect(int skillid, int effectid, int playerLevel, int skillLevel, byte direction) {
/*  35 */     return showBuffeffect(null, skillid, effectid, playerLevel, skillLevel, direction);
   }

   public static byte[] showBuffeffect(MapleCharacter chr, int skillid, int effectid, int playerLevel, int skillLevel) {
/*  39 */     return showBuffeffect(chr, skillid, effectid, playerLevel, skillLevel, (byte)4);
   }

   public static byte[] showBuffeffect(MapleCharacter chr, int skillid, int effectid, int playerLevel, int skillLevel, byte direction) {
/*  43 */     return showBuffeffect(chr, skillid, effectid, playerLevel, skillLevel, (byte)0, 0, 0, new Point());
   }

   public static byte[] showBuffeffect(MapleCharacter chr, int skillid, int effectid, int playerLevel, int skillLevel, byte direction, int mobOid, int mobid, Point point) {
/*  47 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/*  48 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  50 */     if (chr == null) {
/*  51 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/*  53 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/*  54 */       mplew.writeInt(chr.getId());
     }
/*  56 */     mplew.write(effectid);
/*  57 */     if (effectid == 2) {
/*  58 */       mplew.writeInt(0);
     }
/*  60 */     mplew.writeInt(skillid);
/*  61 */     mplew.writeInt(playerLevel);
/*  62 */     mplew.writeInt(skillLevel);
/*  63 */     if (effectid != 3) {
/*  64 */       mplew.write(direction);
     }
/*  66 */     switch (skillid) {
       case 65121052:
/*  68 */         if (chr != null) {
/*  69 */           mplew.writeInt((chr.getTruePosition()).x);
/*  70 */           mplew.writeInt((chr.getTruePosition()).y);
         } else {
/*  72 */           mplew.writeLong(0L);
         }
/*  74 */         mplew.write(1);
         break;
       case 1320016:
       case 22170074:
/*  78 */         mplew.write(0);
         break;

       case 4331006:
/*  82 */         mplew.write(0);
/*  83 */         mplew.writeInt(0);
         break;

       case 3111010:
       case 3211010:
       case 21100012:
/*  89 */         mplew.write(0);
/*  90 */         mplew.writeInt(0);
/*  91 */         mplew.writeInt(0);
/*  92 */         mplew.writeInt(0);
         break;

       case 30001061:
/*  96 */         mplew.write(0);
         break;

       case 60001218:
       case 60011218:
       case 400001000:
/* 102 */         mplew.writeInt(0);
/* 103 */         mplew.writeInt(0);
/* 104 */         mplew.writeInt(0);
         break;

       case 4211016:
       case 5081021:
       case 15001019:
       case 15001021:
       case 20041222:
       case 20051284:
       case 152001005:
       case 400041026:
/* 115 */         mplew.writeInt(0);
/* 116 */         mplew.writeInt(0);
/* 117 */         mplew.writeInt(0);
/* 118 */         mplew.writeInt(0);

       case 164001002:
/* 121 */         mplew.writeInt(mobOid);
/* 122 */         mplew.writeInt(mobid);
         break;
     }

/* 126 */     if (skillid != 15001021 && skillid != 20051284 && skillid != 4211016 && skillid != 5081021) {
/* 127 */       switch (skillid) {
         case 4221052:
         case 65121052:
/* 130 */           if (chr != null) {
/* 131 */             mplew.writeInt((chr.getTruePosition()).x);
/* 132 */             mplew.writeInt((chr.getTruePosition()).y); break;
           }
/* 134 */           mplew.writeLong(0L);
           break;


         case 37000010:
         case 37001001:
         case 37100002:
         case 37101001:
         case 37110001:
         case 37110004:
         case 37111000:
         case 37111003:
/* 146 */           mplew.writeInt(0);
           break;

         case 400041011:
         case 400041012:
         case 400041013:
         case 400041014:
         case 400041015:
/* 154 */           mplew.writeInt(0);
           break;
       }
     }
/* 158 */     if (chr == null && skillid == 30001062) {
/* 159 */       mplew.write(0);
/* 160 */       mplew.writeShort(0);
/* 161 */       mplew.writeShort(0);
     }
/* 163 */     mplew.writeInt(0);

/* 165 */     if (skillid == 64001000) {
/* 166 */       mplew.writePosAsInt((point == null) ? new Point() : point);
     }

/* 169 */     return mplew.getPacket();
   }

   public static byte[] showEffect(int cid, int skillid, int effectid, int duration, boolean foreign) {
/* 173 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 175 */     if (!foreign) {
/* 176 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 178 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 179 */       mplew.writeInt(cid);
     }
/* 181 */     mplew.write(effectid);
/* 182 */     mplew.writeInt(skillid);
/* 183 */     mplew.writeInt(duration);

/* 185 */     return mplew.getPacket();
   }




   public static byte[] showOwnDiceEffect(int skillid, int effectid, int effectid2, int level) {
/* 192 */     return showDiceEffect(-1, skillid, effectid, effectid2, level);
   }




   public static byte[] showDiceEffect(int chrId, int skillid, int effectid, int effectid2, int level) {
/* 199 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 200 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 202 */     if (chrId == -1) {
/* 203 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 205 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 206 */       mplew.writeInt(chrId);
     }
/* 208 */     mplew.write(EffectOpcode.UserEffect_SkillAffected_Select.getValue());
/* 209 */     mplew.writeInt(effectid);
/* 210 */     mplew.writeInt(effectid2);
/* 211 */     mplew.writeInt(skillid);
/* 212 */     mplew.write(level);
/* 213 */     mplew.write(0);

/* 215 */     return mplew.getPacket();
   }




   public static byte[] showItemLevelupEffect() {
/* 222 */     return showSpecialEffect(EffectOpcode.UserEffect_ItemLevelUp.getValue());
   }




   public static byte[] showForeignItemLevelupEffect(int chrId) {
/* 229 */     return showForeignEffect(chrId, EffectOpcode.UserEffect_ItemLevelUp.getValue());
   }

















   public static byte[] showSpecialEffect(int effect) {
/* 249 */     return showForeignEffect(-1, effect);
   }

   public static byte[] showForeignEffect(int chrId, int effect) {
/* 253 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 254 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 256 */     if (chrId == -1) {
/* 257 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 259 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 260 */       mplew.writeInt(chrId);
     }
/* 262 */     mplew.write(effect);

/* 264 */     return mplew.getPacket();
   }









   public static byte[] showOwnHpHealed(int amount) {
/* 276 */     return showHpHealed(-1, amount);
   }





   public static byte[] showHpHealed(int chrId, int amount) {
/* 284 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 285 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 287 */     if (chrId == -1) {
/* 288 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 290 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 291 */       mplew.writeInt(chrId);
     }
/* 293 */     mplew.write(EffectOpcode.UserEffect_IncDecHPRegenEffect.getValue());
/* 294 */     mplew.writeInt(amount);

/* 296 */     return mplew.getPacket();
   }





   public static byte[] showBlessOfDarkness(int skillId) {
/* 304 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 305 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 307 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 308 */     mplew.write(EffectOpcode.UserEffect_SkillSpecial.getValue());
/* 309 */     mplew.writeInt(skillId);

/* 311 */     return mplew.getPacket();
   }





   public static byte[] showOwnCraftingEffect(String effect, int time, int mode) {
/* 319 */     return showCraftingEffect(-1, effect, time, mode);
   }





   public static byte[] showCraftingEffect(int chrId, String effect, int time, int mode) {
/* 327 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 328 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 330 */     if (chrId == -1) {
/* 331 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 333 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 334 */       mplew.writeInt(chrId);
     }
/* 336 */     mplew.write(EffectOpcode.UserEffect_EffectUOL.getValue());
/* 337 */     mplew.writeMapleAsciiString(effect);
/* 338 */     mplew.write(1);
/* 339 */     mplew.writeInt(time);
/* 340 */     mplew.writeInt(mode);

/* 342 */     return mplew.getPacket();
   }




   public static byte[] showOwnJobChangedElf(String effect, int time, int itemId) {
/* 349 */     return showJobChangedElf(-1, effect, time, itemId);
   }




   public static byte[] showJobChangedElf(int chrId, String effect, int time, int itemId) {
/* 356 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 357 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 359 */     if (chrId == -1) {
/* 360 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 362 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 363 */       mplew.writeInt(chrId);
     }
/* 365 */     mplew.write(EffectOpcode.UserEffect_EffectUOL.getValue());
/* 366 */     mplew.writeMapleAsciiString(effect);
/* 367 */     mplew.write(1);
/* 368 */     mplew.writeInt(0);
/* 369 */     mplew.writeInt(time);
/* 370 */     mplew.writeInt(itemId);

/* 372 */     return mplew.getPacket();
   }





   public static byte[] showRewardItemAnimation(int itemId, String effect) {
/* 380 */     return showRewardItemAnimation(itemId, effect, -1);
   }




   public static byte[] showRewardItemAnimation(int itemId, String effect, int chrId) {
/* 387 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 388 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 390 */     if (chrId == -1) {
/* 391 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 393 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 394 */       mplew.writeInt(chrId);
     }
/* 396 */     mplew.write(EffectOpcode.UserEffect_LotteryUse.getValue());
/* 397 */     mplew.writeInt(itemId);
/* 398 */     mplew.write((effect != null && effect.length() > 0) ? 1 : 0);
/* 399 */     if (effect != null && effect.length() > 0) {
/* 400 */       mplew.writeMapleAsciiString(effect);
     }

/* 403 */     return mplew.getPacket();
   }




   public static byte[] Mulung_DojoUp2() {
/* 410 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 411 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 413 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 414 */     mplew.write(EffectOpcode.UserEffect_PlayPortalSE.getValue());

/* 416 */     return mplew.getPacket();
   }





   public static byte[] ItemMaker_Success() {
/* 424 */     return ItemMaker_Success_3rdParty(-1);
   }

   public static byte[] ItemMaker_Success_3rdParty(int chrId) {
/* 428 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 429 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 431 */     if (chrId == -1) {
/* 432 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 434 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 435 */       mplew.writeInt(chrId);
     }
/* 437 */     mplew.write(EffectOpcode.UserEffect_ItemMaker.getValue());
/* 438 */     mplew.writeInt(0);

/* 440 */     return mplew.getPacket();
   }





   public static byte[] showOwnPetLevelUp(byte index) {
/* 448 */     return showPetLevelUp(-1, index);
   }

   public static byte[] showPetLevelUp(int chrId, byte index) {
/* 452 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 454 */     if (chrId == -1) {
/* 455 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 457 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 458 */       mplew.writeInt(chrId);
     }
/* 460 */     mplew.write(EffectOpcode.UserEffect_Pet.getValue());
/* 461 */     mplew.write(0);
/* 462 */     mplew.writeInt(index);

/* 464 */     return mplew.getPacket();
   }




   public static byte[] AranTutInstructionalBalloon(String data) {
/* 471 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 472 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 474 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 475 */     mplew.write(EffectOpcode.UserEffect_AvatarOriented.getValue());
/* 476 */     mplew.writeMapleAsciiString(data);

/* 478 */     return mplew.getPacket();
   }




   public static byte[] ShowWZEffect(String data) {
/* 485 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 486 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 488 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 489 */     mplew.write(EffectOpcode.UserEffect_PlaySoundWithMuteBGM.getValue());
/* 490 */     mplew.writeMapleAsciiString(data);

/* 492 */     return mplew.getPacket();
   }





   public static byte[] getShowItemGain(List<Pair<Integer, Integer>> showItems) {
/* 500 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 501 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 503 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 504 */     mplew.write(EffectOpcode.UserEffect_Quest.getValue());
/* 505 */     mplew.write(showItems.size());
/* 506 */     for (Pair<Integer, Integer> items : showItems) {
/* 507 */       mplew.writeInt(((Integer)items.left).intValue());
/* 508 */       mplew.writeInt(((Integer)items.right).intValue());
     }
/* 510 */     return mplew.getPacket();
   }

   public static byte[] getShowItemGain(int itemid, short amount, boolean b) {
/* 514 */     if (ServerConfig.DEBUG_MODE) {
/* 515 */       log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
     }
/* 517 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 518 */     if (b) {
/* 519 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 520 */       mplew.write(EffectOpcode.UserEffect_Quest.getValue());
/* 521 */       mplew.write(1);
     } else {
/* 523 */       mplew.writeShort(SendPacketOpcode.SHOW_STATUS_INFO.getValue());
/* 524 */       mplew.writeShort(MessageOpcode.MS_DropPickUpMessage.getValue());
     }
/* 526 */     mplew.writeInt(itemid);
/* 527 */     mplew.writeInt(amount);

/* 529 */     return mplew.getPacket();
   }




   public static byte[] showOwnXenonPowerOn(String effect) {
/* 536 */     return showXenonPowerOn(-1, effect);
   }

   public static byte[] showXenonPowerOn(int chrId, String effect) {
/* 540 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 541 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 543 */     if (chrId == -1) {
/* 544 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 546 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 547 */       mplew.writeInt(chrId);
     }
/* 549 */     mplew.write(EffectOpcode.UserEffect_UpgradeTombItemUse.getValue());
/* 550 */     mplew.writeMapleAsciiString(effect);

/* 552 */     return mplew.getPacket();
   }




   public static byte[] showArrowsEffect(int skillId, int mode, int arrows) {
/* 559 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 560 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();


/* 563 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 564 */     mplew.write(EffectOpcode.UserEffect_SkillMode.getValue());
/* 565 */     mplew.writeInt(skillId);
/* 566 */     mplew.writeInt(mode);
/* 567 */     mplew.writeInt(arrows);

/* 569 */     return mplew.getPacket();
   }

   public static byte[] show影朋小白效果(int skillid) {
/* 573 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 574 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();


/* 577 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 578 */     mplew.write(EffectOpcode.HakuSkillEffect.getValue());
/* 579 */     mplew.writeShort(0);
/* 580 */     mplew.writeInt(skillid);
/* 581 */     mplew.write(1);
/* 582 */     mplew.writeShort(15);

/* 584 */     return mplew.getPacket();
   }

   public static byte[] playerDeadConfirm(int type, int value) {
/* 588 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 590 */     mplew.writeShort(SendPacketOpcode.PLAYER_DEAD.getValue());
/* 591 */     mplew.writeInt(type);
/* 592 */     mplew.write(0);
/* 593 */     if ((type & 0x1) != 0) {
/* 594 */       mplew.writeInt(value);
     }
/* 596 */     if ((type & 0x2) != 0) {
/* 597 */       mplew.writeInt(0);
     }

/* 600 */     return mplew.getPacket();
   }

   public static byte[] getReviveEffect(int oneProgressBartime, int towProgressBartime) {
/* 604 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 605 */     mplew.writeShort(SendPacketOpcode.SHOW_REVIVE_EFFECT.getValue());
/* 606 */     mplew.writeInt(oneProgressBartime);
/* 607 */     mplew.writeInt(towProgressBartime);
/* 608 */     mplew.writeBool(false);
/* 609 */     return mplew.getPacket();
   }

   public static byte[] getEffectSwitch(int cid, List<Integer> items) {
/* 613 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 615 */     mplew.writeShort(SendPacketOpcode.EFFECT_SWITCH.getValue());
/* 616 */     mplew.writeInt(cid);
/* 617 */     mplew.writeInt(items.size());
/* 618 */     for (Iterator<Integer> iterator = items.iterator(); iterator.hasNext(); ) { int i = ((Integer)iterator.next()).intValue();
/* 619 */       mplew.writeInt(i); }

/* 621 */     mplew.writeBool(false);

/* 623 */     return mplew.getPacket();
   }


   public static byte[] showKSPsychicGrab(int cid, int skillid, short skilllevel, List<KSPsychicSkillEntry> ksse) {
/* 628 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 629 */     mplew.writeShort(SendPacketOpcode.GIVE_KSPSYCHIC.getValue());

/* 631 */     mplew.writeInt(cid);
/* 632 */     mplew.write(1);
/* 633 */     mplew.writeInt(skillid);
/* 634 */     mplew.writeShort(skilllevel);
/* 635 */     mplew.writeInt(1199);
/* 636 */     mplew.writeInt(6);

/* 638 */     for (KSPsychicSkillEntry k : ksse) {
/* 639 */       mplew.write(1);
/* 640 */       mplew.write(1);
/* 641 */       mplew.writeInt(k.getOid());
/* 642 */       mplew.writeInt(Math.abs(k.getOid()));
/* 643 */       if (k.getMobOid() != 0) {
/* 644 */         mplew.writeInt(k.getMobOid());
/* 645 */         mplew.writeShort(0);
/* 646 */         mplew.writeLong(150520L);
/* 647 */         mplew.writeLong(150520L);
       } else {
/* 649 */         mplew.writeInt(0);
/* 650 */         mplew.writeShort(Randomizer.nextInt(19) + 1);
/* 651 */         mplew.writeLong(100L);
/* 652 */         mplew.writeLong(100L);
       }
/* 654 */       mplew.write(1);
/* 655 */       mplew.writeInt(k.getN1());
/* 656 */       mplew.writeInt(k.getN2());
/* 657 */       mplew.writeInt(k.getN3());
/* 658 */       mplew.writeInt(k.getN4());
     }
/* 660 */     mplew.write(0);

/* 662 */     return mplew.getPacket();
   }

   public static byte[] showKSPsychicAttack(int cid, int skillid, short skilllevel, int n1, int n2, byte n3, int n4, int n5, int n6, int n7, int n8, short n9, short n10) {
/* 666 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 667 */     mplew.writeShort(SendPacketOpcode.ATTACK_KSPSYCHIC.getValue());

/* 669 */     mplew.writeInt(cid);
/* 670 */     mplew.writeInt(skillid);
/* 671 */     mplew.writeShort(skilllevel);
/* 672 */     mplew.writeInt(n1);
/* 673 */     mplew.writeInt(n2);
/* 674 */     mplew.write(n3);
/* 675 */     mplew.writeInt(n4);
/* 676 */     if (n4 != 0) {
/* 677 */       mplew.writeInt(n5);
/* 678 */       mplew.writeInt(n6);
     }
/* 680 */     mplew.writeInt(n7);
/* 681 */     mplew.writeInt(n8);
/* 682 */     mplew.writeShort(n9);
/* 683 */     mplew.writeShort(n10);





/* 689 */     return mplew.getPacket();
   }

   public static byte[] showKSPsychicRelease(int cid, int oid) {
/* 693 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 694 */     mplew.writeShort(SendPacketOpcode.CANCEL_KSPSYCHIC.getValue());

/* 696 */     mplew.writeInt(cid);
/* 697 */     mplew.writeInt(oid);

/* 699 */     return mplew.getPacket();
   }

   public static byte[] showGiveKSUltimate(int chrid, int mode, int type, int oid, int skillid, short skilllevel, int n1, byte n2, short n3, short n4, short n5, int n6, int n7) {
/* 703 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 704 */     mplew.writeShort(SendPacketOpcode.GIVE_KSULTIMATE.getValue());

/* 706 */     mplew.writeInt(chrid);
/* 707 */     mplew.write(1);
/* 708 */     mplew.writeInt(mode);
/* 709 */     mplew.writeInt(type);
/* 710 */     mplew.writeInt(oid);
/* 711 */     mplew.writeInt(skillid);
/* 712 */     mplew.writeShort(skilllevel);
/* 713 */     mplew.writeInt(Math.abs(oid));
/* 714 */     mplew.writeInt(n1);
/* 715 */     mplew.write(n2);
/* 716 */     mplew.writeShort(n3);
/* 717 */     mplew.writeShort(n4);
/* 718 */     mplew.writeShort(n5);
/* 719 */     mplew.writeInt(n6);
/* 720 */     mplew.writeInt(n7);

/* 722 */     return mplew.getPacket();
   }

   public static byte[] showAttackKSUltimate(int oid, int attackcount) {
/* 726 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 727 */     mplew.writeShort(SendPacketOpcode.KSULTIMATE_ATTACK.getValue());

/* 729 */     mplew.writeInt(oid);
/* 730 */     mplew.writeInt(attackcount);

/* 732 */     return mplew.getPacket();
   }

   public static byte[] showCancelKSUltimate(int chrid, int oid) {
/* 736 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 737 */     mplew.writeShort(SendPacketOpcode.CANCEL_KSULTIMATE.getValue());

/* 739 */     mplew.writeInt(chrid);
/* 740 */     mplew.writeInt(oid);

/* 742 */     return mplew.getPacket();
   }


   public static byte[] showExpertEffect() {
/* 747 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 749 */     mplew.writeShort(SendPacketOpcode.EXPERT_EFFECT.getValue());

/* 751 */     return mplew.getPacket();
   }







   public static byte[] showCombustionMessage(String text, int second) {
/* 761 */     if (ServerConfig.DEBUG_MODE) {
/* 762 */       log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
     }
/* 764 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 766 */     mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
/* 767 */     mplew.write(EffectOpcode.UserEffect_TextEffect.getValue());
/* 768 */     mplew.writeMapleAsciiString("#fnNanum GothicExtraBold##fs26#" + text);
/* 769 */     mplew.writeInt(100);
/* 770 */     mplew.writeInt(second * 1000);
/* 771 */     mplew.writeInt(4);
/* 772 */     mplew.writeInt(0);
/* 773 */     mplew.writeInt(-200);
/* 774 */     mplew.writeInt(1);
/* 775 */     mplew.writeInt(4);
/* 776 */     mplew.writeInt(2);
/* 777 */     mplew.writeLong(0L);
/* 778 */     mplew.writeShort(0);

/* 780 */     return mplew.getPacket();
   }


   public static byte[] showHpHealed_Other(int chrId, int amount) {
/* 785 */     if (ServerConfig.DEBUG_MODE) {
/* 786 */       log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
     }
/* 788 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 790 */     mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 791 */     mplew.writeInt(chrId);
/* 792 */     mplew.write(EffectOpcode.UserEffect_IncDecHPRegenEffect.getValue());
/* 793 */     mplew.writeInt(amount);

/* 795 */     return mplew.getPacket();
   }

   public static byte[] showDamageSkin(MapleCharacter chr) {
/* 799 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 800 */     if (ServerConfig.DEBUG_MODE) {
/* 801 */       log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
     }
/* 803 */     mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_DAMAGE_SKIN.getValue());
/* 804 */     mplew.writeInt(chr.getId());
/* 805 */     mplew.writeInt(0);
/* 806 */     mplew.writeMapleAsciiString("");
/* 807 */     mplew.writeMapleAsciiString("");
/* 808 */     return mplew.getPacket();
   }




   public static byte[] showEnergyCharge(int skillid, int playerlevel, int skilllevel) {
/* 815 */     return showEnergyCharge(null, skillid, playerlevel, skilllevel);
   }




   public static byte[] showEnergyCharge(MapleCharacter chr, int skillid, int playerlevel, int skilllevel) {
/* 822 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 823 */     if (ServerConfig.DEBUG_MODE) {
/* 824 */       log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
     }
/* 826 */     if (chr == null) {
/* 827 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 829 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 830 */       mplew.writeInt(chr.getId());
     }
/* 832 */     mplew.write(EffectOpcode.UserEffect_SkillAffected.getValue());
/* 833 */     mplew.writeInt(skillid);
/* 834 */     mplew.writeInt(playerlevel);
/* 835 */     mplew.write(skilllevel);
/* 836 */     mplew.write(1);

/* 838 */     return mplew.getPacket();
   }




   public static byte[] showSkillEffect(int skillid, int skilllevel) {
/* 845 */     return showSkillEffect(null, skillid, skilllevel);
   }




   public static byte[] showSkillEffect(MapleCharacter chr, int skillid, int skilllevel) {
/* 852 */     log.info("调用"+Thread.currentThread().getStackTrace()[1].getMethodName());
/* 853 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 855 */     if (chr == null) {
/* 856 */       mplew.writeShort(SendPacketOpcode.SHOW_SPECIAL_EFFECT.getValue());
     } else {
/* 858 */       mplew.writeShort(SendPacketOpcode.SHOW_FOREIGN_EFFECT.getValue());
/* 859 */       mplew.writeInt(chr.getId());
     }
/* 861 */     mplew.write(EffectOpcode.UserEffect_SkillAffected.getValue());
/* 862 */     mplew.writeInt(skillid);
/* 863 */     mplew.write(skilllevel);

/* 865 */     return mplew.getPacket();
   }

   public static final byte[] showRoyalGuardAttack() {
/* 869 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 871 */     mplew.writeShort(SendPacketOpcode.ROYAL_GUARD_ATTACK.getValue());

/* 873 */     return mplew.getPacket();
   }




   public static byte[] showXSSkillEffect(MapleCharacter chr, int skillid, int playerLevel, int mobOid, int mobid, int skillLevel) {
/* 880 */     return showBuffeffect(chr, skillid, EffectOpcode.UserEffect_SkillUse.getValue(), playerLevel, skillLevel, (byte)0);
   }
 }


/* Location:              C:\PGX\Server.jar!\tools\packet\EffectPacket.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */